<template>
  <div class="home">
    <img alt="Vue logo" src="../assets/logo.png">
    <HelloWorld msg="Welcome to Your Vue.js App"/>
    <button @click="clickButton">asdasd</button>
  </div>
</template>

<script>
// @ is an alias to /src
import HelloWorld from '@/components/HelloWorld.vue'
import { loginByUsername, getUserInfo } from '../api/login'

export default {
  name: 'HomeView',
  components: {
    HelloWorld
  },
  methods: {
    async login () {
      const res = await loginByUsername('useradmin', '1qazXSW!@#')
      console.log(res)
    },
    clickButton () {
      getUserInfo(1)
    }
  },
  created () {
    this.login()
  }
}
</script>
